package com.donfu.system.service.house.impl;

import java.util.List;
import java.util.Map;

import com.donfu.common.utils.DateUtils;
import com.donfu.system.domain.house.HouseOrderGoods;
import com.donfu.system.mapper.house.HouseOrderGoodsMapper;
import com.donfu.system.service.house.IHouseOrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 订单商品Service业务层处理
 * 
 * @author donfu
 * @date 2021-12-06
 */
@Service
public class HouseOrderGoodsServiceImpl implements IHouseOrderGoodsService
{
    @Autowired
    private HouseOrderGoodsMapper houseOrderGoodsMapper;

    /**
     * 查询订单商品
     * 
     * @param id 订单商品主键
     * @return 订单商品
     */
    @Override
    public HouseOrderGoods selectHouseOrderGoodsById(Long id)
    {
        return houseOrderGoodsMapper.selectHouseOrderGoodsById(id);
    }

    /**
     * 查询订单商品列表
     * 
     * @param houseOrderGoods 订单商品
     * @return 订单商品
     */
    @Override
    public List<HouseOrderGoods> selectHouseOrderGoodsList(HouseOrderGoods houseOrderGoods)
    {
        return houseOrderGoodsMapper.selectHouseOrderGoodsList(houseOrderGoods);
    }

    /**
     * 新增订单商品
     * 
     * @param houseOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int insertHouseOrderGoods(HouseOrderGoods houseOrderGoods)
    {
        return houseOrderGoodsMapper.insertHouseOrderGoods(houseOrderGoods);
    }

    /**
     * 修改订单商品
     * 
     * @param houseOrderGoods 订单商品
     * @return 结果
     */
    @Override
    public int updateHouseOrderGoods(HouseOrderGoods houseOrderGoods)
    {
        return houseOrderGoodsMapper.updateHouseOrderGoods(houseOrderGoods);
    }

    /**
     * 批量删除订单商品
     * 
     * @param ids 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteHouseOrderGoodsByIds(Long[] ids)
    {
        return houseOrderGoodsMapper.deleteHouseOrderGoodsByIds(ids);
    }

    /**
     * 删除订单商品信息
     * 
     * @param id 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteHouseOrderGoodsById(Long id)
    {
        return houseOrderGoodsMapper.deleteHouseOrderGoodsById(id);
    }

    @Override
    public List<Map<String, Object>> getMyOrderList(Long houseOrderId) {
        return houseOrderGoodsMapper.getMyOrderList(houseOrderId);
    }
}
